<?php

/**
 * Api Model 类
 * @author: 喵了个咪  <wenzhenxi@vip.qq.com> 2015-07-23
 */
class Model_Api extends PhalApi_Model_NotORM {

    protected function getTableName($id) {

        return 'api';
    }

    /**
     * 通过APIId列表获取接口清单
     */
    public function getapiIdListByapiList($apiIdList) {

        return $this->getORM()->select('apiId,name')->where('apiId', $apiIdList)->where('type', 1)->fetchAll();
    }

    /**
     * 过滤
     */
    public function filterId($ApiIdList) {

        return $this->getORM()->select('apiId')->where('apiId', $ApiIdList)->where('type', 1)->fetchAll();
    }

    /**
     * 验证用户是否拥有权限
     */
    public function validation($apiname, $ApiIdList) {

        return $this->getORM()->select('apiId')->where('apiId', $ApiIdList)->where('apiname', $apiname)->where('type', 1)->fetchAll();
    }

}
